package com.property.management.service.impl;

import java.util.List;
import com.property.common.utils.DateUtils;
import com.property.common.utils.ShiroUtils;
import com.property.management.mapper.CourtInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.property.management.mapper.PayInfoMapper;
import com.property.management.domain.PayInfo;
import com.property.management.service.IPayInfoService;
import com.property.common.core.text.Convert;

/**
 * 缴费信息Service业务层处理
 * 
 * @author property
 * @date 2021-05-06
 */
@Service
public class PayInfoServiceImpl implements IPayInfoService 
{
    @Autowired
    private PayInfoMapper payInfoMapper;
    @Autowired
    private CourtInfoMapper courtInfoMapper;
    /**
     * 查询缴费信息
     * 
     * @param id 缴费信息ID
     * @return 缴费信息
     */
    @Override
    public PayInfo selectPayInfoById(Integer id)
    {
        return payInfoMapper.selectPayInfoById(id);
    }

    /**
     * 查询缴费信息列表
     * 
     * @param payInfo 缴费信息
     * @return 缴费信息
     */
    @Override
    public List<PayInfo> selectPayInfoList(PayInfo payInfo)
    {
        return payInfoMapper.selectPayInfoList(payInfo);
    }

    /**
     * 新增缴费信息
     * 
     * @param payInfo 缴费信息
     * @return 结果
     */
    @Override
    public int insertPayInfo(PayInfo payInfo)
    {
        payInfo.setCreateTime(DateUtils.getNowDate());
        return payInfoMapper.insertPayInfo(payInfo);
    }

    /**
     * 修改缴费信息
     * 
     * @param payInfo 缴费信息
     * @return 结果
     */
    @Override
    public int updatePayInfo(PayInfo payInfo)
    {
        payInfo.setUpdateTime(DateUtils.getNowDate());
        return payInfoMapper.updatePayInfo(payInfo);
    }

    /**
     * 删除缴费信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deletePayInfoByIds(String ids)
    {
        return payInfoMapper.deletePayInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除缴费信息信息
     * 
     * @param id 缴费信息ID
     * @return 结果
     */
    @Override
    public int deletePayInfoById(Integer id)
    {
        return payInfoMapper.deletePayInfoById(id);
    }

    @Override
    public void expirePayInfo() {
        payInfoMapper.expirePayInfo();
    }
}
